<template>
	<view class="container">
		<view class="header">
			<view class="user">
				<view class="image">
					<image :src="userAvatar || '/static/mine/default.png'" style="width: 210rpx; height: 210rpx;"></image>
				</view>
				<view class="info">
					<view>姓名：{{nicname}}</view>
					<view>角色：{{user}}</view>
				</view>
			</view>
		</view>
		<view class="menu-box">
			<view class="menu-row">
				<uni-icons color="#3079bd" type="person" size="26"></uni-icons>
				<view class="menu-row-content">姓名</view>
				<text class="menu-row-content-text">厂长</text>
			</view>
			<view class="menu-row">
				<uni-icons color="#3079bd" type="phone" size="26"></uni-icons>
				<view class="menu-row-content">电话</view>
				<text class="menu-row-content-text">18264068246</text>
			</view>
			<view class="menu-row">
				<uni-icons color="#3079bd" type="staff" size="26"></uni-icons>
				<view class="menu-row-content">部门</view>
				<text class="menu-row-content-text">管理</text>
			</view>
			<view class="menu-row" @click="toUpdatePassword">
				<uni-icons color="#3079bd" type="info" size="26"></uni-icons>
				<view class="menu-row-content">修改密码</view>
				<uni-icons color="#5b5b5b" type="right" size="24" style="margin-left: auto;"></uni-icons>
			</view>
		</view>
		<view class="navigation-button">
			<button type="primary" size="default" @click="toSignOut">退出账号</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userAvatar: '', // 用户上传的图片路径
				nicname: 'admin', // 用户昵称
				user: '厂长' // 用户角色
			}
		},
		onLoad() {

		},
		methods: {
			toSignOut(){
				uni.navigateTo({
					url:'/pages/login/index'
				})
			},
			toUpdatePassword(){
				uni.navigateTo({
					url:'/pages/updatePassword/index'
				})
			}
		}
	}
</script>

<style>
	.container {
	  display: flex;
	  flex-direction: column;
	  height: 100vh;
	  background-color: #f5f5f5;
	}
	.header{
	  display: flex;
	  /* padding: 60rpx; */
	  /* background-color: #fff; */
	  /* margin: 60rpx 40rpx 20rpx 30rpx; */
	  border-radius: 0 0 20rpx 20rpx;
	  position: relative;
	  width: 100%;
	  height: 380rpx;
	  background: linear-gradient(to bottom, #4191ea,#83c6ed);
	}
	.user{
		display: flex;
		padding: 60rpx;
	}
	.image{
		display: flex;
		align-items: center;
	}	
	.info{
		display: flex;
		flex-direction: column;
		justify-content: center;
		margin-left: 120rpx;
		line-height: 70rpx;
		font-size: 30rpx;
		font-weight: bold;
		align-items: left;
		color:#fff;
	}
	.menu-box{
		display: flex;
		flex-direction: column;
		margin: 30rpx 20rpx;
	}
	.menu-row{
		display: flex;
		border-bottom: 1px solid #ccc;
		background-color: #ffffff;
		line-height: 70rpx;
		margin: 5rpx 0 5rpx 0;
	}
	.menu-row-content{
		margin-left: 40rpx;
		color: #3b3b3b;
	}
	.menu-row-content-text{
		flex-grow: 1;
		text-align: center;
	}
	/* 修改按钮背景颜色 */
	.navigation-button button {
		margin: 200rpx 120rpx 120rpx 120rpx;
		background-color: #83c6ed; /* 设置新的背景颜色 */
	}
	.navigation-button button:active{
		background-color: #4aadee; /* 设置新的背景颜色 */
	}
</style>
